<template>
  <a-form layout="inline" @submit="handleSubmit">
    <a-form-model-item label="姓名">
      <a-input
        v-model="formData.realName"
        class="yy-a-input"
        placeholder="请输入您的姓名"
      ></a-input
    ></a-form-model-item>
    <a-form-model-item label="身份证号">
      <a-input
        v-model="formData.idCard"
        class="yy-a-input"
        placeholder="请输入您的身份证号"
      ></a-input
    ></a-form-model-item>
    <a-form-model-item label="手机号码">
      <a-input
        v-model="formData.phone"
        class="yy-a-input"
        placeholder="请输入您的手机号码"
      ></a-input
    ></a-form-model-item>
    <a-form-model-item label="人员性质">
      <a-radio-group v-model="formData.personType">
        <a-radio :value="1"> 常住 </a-radio>
        <a-radio :value="2"> 租户 </a-radio>
        <a-radio :value="3"> 访客 </a-radio>
      </a-radio-group>
    </a-form-model-item>
    <a-form-model-item label="社区名称">
      <a-input v-model="formData.communityLocation"></a-input
    ></a-form-model-item>
    <a-form-model-item label="详细地址">
      <a-input
        v-model="formData.address"
        class="yy-a-input"
        placeholder="例:小区名、楼栋号、单元室"
      ></a-input
    ></a-form-model-item>

    <a-form-model-item label="紧急联系人">
      <a-input
        v-model="formData.emergencyContact"
        class="yy-a-input"
        placeholder="请输入您的紧急联系人"
      ></a-input
    ></a-form-model-item>
    <a-form-model-item label="紧急联系人电话">
      <a-input
        v-model="formData.emergencyContactPhone"
        class="yy-a-input"
        placeholder="请输入您的紧急联系人电话"
      ></a-input
    ></a-form-model-item>
    <a-form-model-item label="是否隔离观察">
      <a-radio-group v-model="formData.isolationObservation">
        <a-radio :value="1"> 是</a-radio>
        <a-radio :value="0"> 否</a-radio>
      </a-radio-group></a-form-model-item
    >

    <a-form-model-item label="体温是否正常">
      <a-radio-group v-model="formData.normalTemperature">
        <a-radio :value="1"> 是</a-radio> <a-radio :value="0"> 否</a-radio>
      </a-radio-group>
    </a-form-model-item>
    <a-form-model-item label="是否有湖北旅居史">
      <a-radio-group v-model="formData.gotoHubei">
        <a-radio :value="1"> 是</a-radio>
        <a-radio :value="0"> 否</a-radio>
      </a-radio-group>
    </a-form-model-item>
    <a-form-model-item label="是否与疫区人员接触">
      <a-radio-group v-model="formData.contactWithEpidemicAreaPeople">
        <a-radio :value="1"> 是</a-radio>
        <a-radio :value="0"> 否</a-radio>
      </a-radio-group></a-form-model-item
    >
    <a-form-model-item label="家庭成员有无异常情况">
      <a-radio-group v-model="formData.familyIsSymptomsWithin14day">
        <a-radio :value="1"> 是</a-radio>
        <a-radio :value="0"> 否</a-radio>
      </a-radio-group></a-form-model-item
    >
    <a-form-model-item label="与确诊/疑似病人接触">
      <a-radio-group v-model="formData.contactWithPatients">
        <a-radio :value="1"> 是</a-radio>
        <a-radio :value="0"> 否</a-radio>
      </a-radio-group></a-form-model-item
    >
    <a-form-model-item label="14天内是否有发热等症状">
      <a-radio-group v-model="formData.symptomsWithin14day">
        <a-radio :value="1"> 是</a-radio>
        <a-radio :value="0"> 否</a-radio>
      </a-radio-group></a-form-model-item
    >
  </a-form></template
>
<script>
export default {
  data () {
    return {
      labelCol: { span: 3 },
      wrapperCol: { span: 12 },
      formData: {}
    };
  },
  mounted () {
    this.$axios.residentDeatil(this.$route.params).then(res => {
      if (res.resultCode == '0') {
        this.formData = res.data;
      }
    });
  },
  methods: {
    handleSubmit (e) {
      e.preventDefault();
      // this.form.validateFields((err, values) => {
      //   if (!err) {
      //     console.log("Received values of form: ", values);
      //   }
      // });
    },
    onSubmit () {
      console.log('submit!', this.form);
    }
  }
};
</script>
<style scoped>
.yy-a-input {
  width: 300px;
}
.ant-form-inline .ant-form-item {
  width: 500px;
  margin: 5px 0px;
}
</style>
